package com.yourname.myapplication.data.room.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.yourname.myapplication.data.model.Question
import com.yourname.myapplication.data.model.WrongQuestion
import kotlinx.coroutines.flow.Flow

@Dao
interface WrongQuestionDao {
    @Insert
    suspend fun insert(wrongQuestion: WrongQuestion)

    @Query("SELECT q.* FROM wrong_questions wq JOIN questions q ON wq.questionId = q.id WHERE wq.userId = :userId")
    fun getWrongQuestionsByUserId(userId: Int): Flow<List<Question>>
}